﻿/**************************************************************
 * St. Sana - A file/folder scanner originall designed for    *
 * Open Media Library (open-media-library.googlecode.com)     *
 *                                                            *
 * Available for use by ANY project that wants to use it.     *
 * St. Sana is covered by the Apache 2 license.               *
 * Feel free to use this software however you like so as long *
 * as you follow the guidelines of above mentioned license.   *
 * Written by David J. Shultz (djshultz@gmail.com)            *
 **************************************************************/

using System;
using System.IO;
using NUnit.Framework;

using StSana;

namespace StSanaTestSuite
{
    [TestFixture]
    public class TSerf
    {
        static public string BASE_TEST_FOLDER = @"..\..\..\Test Scenarios\Other Tests";
        [Test]
        public void TEST__IsValidVideoExtension__METHOD()
        {
            Assert.IsTrue(Serf.IsValidVideoExtension("asf"));
            Assert.IsTrue(Serf.IsValidVideoExtension("avc"));
            Assert.IsTrue(Serf.IsValidVideoExtension("avi"));
            Assert.IsTrue(Serf.IsValidVideoExtension("divx"));
            Assert.IsTrue(Serf.IsValidVideoExtension("h264"));
            Assert.IsTrue(Serf.IsValidVideoExtension("m2ts"));
            Assert.IsTrue(Serf.IsValidVideoExtension("mkv"));
            Assert.IsTrue(Serf.IsValidVideoExtension("mov"));
            Assert.IsTrue(Serf.IsValidVideoExtension("mp4"));
            Assert.IsTrue(Serf.IsValidVideoExtension("mpg"));
            Assert.IsTrue(Serf.IsValidVideoExtension("mpeg"));
            Assert.IsTrue(Serf.IsValidVideoExtension("ogm"));
            Assert.IsTrue(Serf.IsValidVideoExtension("ts"));
            Assert.IsTrue(Serf.IsValidVideoExtension("vob"));
            Assert.IsTrue(Serf.IsValidVideoExtension("wmv"));
            Assert.IsTrue(Serf.IsValidVideoExtension("wtv"));
            Assert.IsTrue(Serf.IsValidVideoExtension("wvx"));
            
        }

        [Test]
        public void TEST__ContainsVideoTSSubFolder__METHOD()
        {
            Assert.IsTrue(Serf.ContainsVideoTSSubFolder(
                Path.Combine(BASE_TEST_FOLDER, @"ContainsVideoTSSubFolder Tests\ContainsVideoTSSubFolder_TRUE")));
            Assert.IsFalse(Serf.ContainsVideoTSSubFolder(
                Path.Combine(BASE_TEST_FOLDER, @"ContainsVideoTSSubFolder Tests\ContainsVideoTSSubFolder_FALSE")));
        }

        [Test]
        public void TEST__ContainsDVDFilesWithoutVideoTSFolder__METHOD()
        {
            Assert.IsTrue(Serf.ContainsDVDFilesWithoutVideoTSFolder(
                Path.Combine(BASE_TEST_FOLDER, @"ContainsDVDFilesWithoutVideoTSFolder\ContainsDVDFilesWithoutVideoTSFolder_TRUE")));

            Assert.IsFalse(Serf.ContainsDVDFilesWithoutVideoTSFolder(
                Path.Combine(BASE_TEST_FOLDER, @"ContainsDVDFilesWithoutVideoTSFolder\ContainsDVDFilesWithoutVideoTSFolder_FALSE")));
        }

        [Test]
        public void TEST__ContainsBDMVSubFolder__METHOD()
        {
            Assert.IsTrue(Serf.ContainsBDMVSubFolder(
                Path.Combine(BASE_TEST_FOLDER, @"ContainsBDMVSubFolder Tests\ContainsBDMVSubFolder_TRUE")));
            Assert.IsFalse(Serf.ContainsBDMVSubFolder(
                Path.Combine(BASE_TEST_FOLDER, @"ContainsBDMVSubFolder Tests\ContainsBDMVSubFolder_FALSE")));
        }

        [Test]
        public void TEST__ContainsBlurayFilesWithoutBDMVFolder_METHOD()
        {
            Assert.IsTrue(Serf.ContainsBlurayFilesWithoutBDMVFolder(
                Path.Combine(BASE_TEST_FOLDER, @"ContainsBlurayFilesWithoutBDMVFolder Tests\ContainsBlurayFilesWithoutBDMVFolder_TRUE")));
            Assert.IsFalse(Serf.ContainsBlurayFilesWithoutBDMVFolder(
                Path.Combine(BASE_TEST_FOLDER, @"ContainsBlurayFilesWithoutBDMVFolder Tests\ContainsBlurayFilesWithoutBDMVFolder_FALSE")));
        }

        [Test]
        public void TEST__ContainsHDDVDSubFolder__METHOD()
        {
            Assert.IsTrue(Serf.ContainsHDDVDSubFolder(
                Path.Combine(BASE_TEST_FOLDER, @"ContainsHDDVDSubFolder Tests\ContainsHDDVDSubFolder_TRUE")));
            Assert.IsFalse(Serf.ContainsHDDVDSubFolder(
                Path.Combine(BASE_TEST_FOLDER, @"ContainsHDDVDSubFolder Tests\ContainsHDDVDSubFolder_FALSE")));
        }
    }
}
